{extend name="/public/admin" /}
{block name="main"}
	<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">
		<div class="row">
			<ol class="breadcrumb">
				<li><a href="/59a3albvcwco"><span class="glyphicon glyphicon-home"></span></a></li>
				<li>商品管理</li>
				<li class="active">商品列表</li>
			</ol>
		</div><!--/.row-->

		<div class="row" style="margin-top: 1em;">
			<div class="col-lg-12">
				<div class="panel panel-default">
					<div class="panel-heading">商品列表</div>
					<div class="panel-body">
						<div class="col-md-12">
							<table class="table">
								<thead>
								<tr>
									<th>Id</th>
									<th>FoodName</th>
									<th>FoodImg</th>
									<th>Classification</th>
									<th>FoodPrice</th>
									<th>AddTime</th>
									<th>Status</th>
									<th>Top</th>
									<th>Operation</th>
								</tr>
								</thead>
								<tbody>
								{foreach $listData as $key=>$val}
									<tr>
										<th scope="row">{$val.id}</th>
										<td>
											{$val.food_name}
										</td>
										<td>
											<a href="{$val.food_img}" target="_blank">点击查看</a> |
											<a href="/lgXnoBdulWquaGue/<?php echo base64_encode($val['id']) ?>">修改图片</a>
										</td>
										<td>
											{$val.type.classification_name}
										</td>
										<td>
											￥{$val.food_price}
										</td>
										<td>
											<?php echo date("Y.m.d ", $val['time']) ?>
										</td>
										<td>
											{eq name="$val['status']" value="0"}<span id="<?php echo 'a'.$val['id'] ?>">已禁用</span>{/eq}
											{eq name="$val['status']" value="1"}<span id="<?php echo 'a'.$val['id'] ?>">已启用</span>{/eq}
										</td>
										<td>
											{eq name="$val['top']" value="0"}<span id="<?php echo 'v'.$val['id'] ?>">未置顶</span>{/eq}
											{gt name="$val['top']" value="0"}<span id="<?php echo 'v'.$val['id'] ?>">已置顶</span>{/gt}
										</td>
										<td>
											<a href="/nKCGrTyeNmiWqyWKi/<?php echo base64_encode($val['id']) ?>">修改商品信息</a> |

											{eq name="$val['status']" value="0"}<a id="<?php echo 's'.$val['id'] ?>" onclick="foodStatusOperationAjax(this)" class="food_status_operation" data-id="{$val.id}" href='#'>点击启用</a>{/eq}
											{eq name="$val['status']" value="1"}<a id="<?php echo 's'.$val['id'] ?>" onclick="foodStatusOperationAjax(this)" class="food_status_operation" data-id="{$val.id}" href='#'>点击禁用</a>{/eq} |

											{eq name="$val['top']" value="0"}<a id="<?php echo 'd'.$val['id'] ?>" onclick="foodTopOperationAjax(this)" class="top_operation" data-id="{$val.id}" href='#'>点击置顶</a>{/eq}
											{gt name="$val['top']" value="0"}<a id="<?php echo 'd'.$val['id'] ?>" onclick="foodTopOperationAjax(this)" class="top_operation" data-id="{$val.id}" href='#'>点击取消置顶</a>{/gt}
										</td>
									</tr>
								{/foreach}
								</tbody>
							</table>
							{$pageNum->render()}
						</div>
					</div>
				</div>
			</div><!-- /.col-->
		</div>
	</div>	<!--/.main-->
{/block}
